﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ClassLibrary.DAO;

public partial class Admin_ucControl_ucOrderDetail : System.Web.UI.UserControl
{
    TblBookingDAO bookingDAO = new TblBookingDAO(Global.CONNECTION_STRING);

    protected void Page_Load(object sender, EventArgs e)
    {
        string id = Request.QueryString["id"];
        if (!IsPostBack)
        {
            DataTable dt = bookingDAO.GetOrder(Global.ConvertToInt(id));
            grdShoppingCart.DataSource = dt;
            grdShoppingCart.DataBind();
            float total = 0;
            if (dt.Rows.Count > 0)
            {
                total += float.Parse(dt.Rows[0]["TotalPrice"].ToString());
            }          
            lblTotal.Text = (total).ToString("c");

            lb_email.Text = dt.Rows[0]["EmailAdress"].ToString();
            lb_name.Text = dt.Rows[0]["Name"].ToString();
            lb_OrderDate.Text = dt.Rows[0]["DateEvent"].ToString();
            lb_phone.Text = dt.Rows[0]["MobilePhone"].ToString();

        }
    }
}
